type Route = {
  /**
   * Any valid URL path
   */
  path?: string;
  /**
   * A React component to render only when the location matches.
   */
  component?: string | (() => any);
  wrappers?: string[];
  /**
   * navigate to a new location
   */
  redirect?: string;
  /**
   * When true, the active class/style will only be applied if the location is matched exactly.
   */
  exact?: boolean;
  routes?: Route[];
  title?: string;
  name?: string;
  key?: string;
};
const WEB_NAME = '学生实训考勤管理系统';
const routes: Route[] = [
  {
    title: `${WEB_NAME}-登录`,
    name: '登录',
    path: '/',
    component: '@/pages/login/index.tsx',
  },
  {
    title: `${WEB_NAME}-登录`,
    name: '登录',
    path: '/login',
    component: '@/pages/login/index.tsx',
  },
  {
    path: '/401',
    component: '@/pages/error/401',
    name: '401',
    key: '401',
  },
  {
    path: '/403',
    component: '@/pages/error/403',
    name: '403',
    key: '403',
  },
  {
    path: '/404',
    component: '@/pages/error/404',
    name: '404',
    key: '404',
  },
  {
    path: '/500',
    component: '@/pages/error/500',
    name: '500',
    key: '500',
  },
  {
    path: '/',
    component: '@/layouts/index',
    routes: [
      /**
       * 公共路由
       */
      {
        title: `修改密码`,
        name: '修改密码',
        path: 'global/changePassword',
        component: '@/pages/global/changePassword/index.tsx',
      },
      {
        path: '/global/homework',
        component: '@/pages/global/homework/index.tsx',
        routes: [
          {
            title: `作业任务`,
            name: '作业任务',
            path: '/global/homework/details',
            component: '@/pages/global/homework/details/index.tsx',
          },
          {
            title: `学生答题`,
            name: '学生答题',
            path: '/global/homework/answer',
            component: '@/pages/global/homework/answer/index.tsx',
          },
          {
            title: `老师批复`,
            name: '老师批复',
            path: '/global/homework/correct',
            component: '@/pages/global/homework/correct/index.tsx',
          },
        ],
      },
      {
        title: `请假处理`,
        name: '请假处理',
        path: '/global/askForLeave/dispose',
        component: '@/pages/global/askForLeave/dispose.tsx',
      },
      {
        title: `请假详情`,
        name: '请假详情',
        path: '/global/askForLeave/particulars',
        component: '@/pages/global/askForLeave/particulars.tsx',
      },
      {
        title: `个人得分`,
        name: '个人得分',
        path: '/global/personage/particulars',
        component: '@/pages/global/grade/personage/particulars/index.tsx',
      },
      {
        title: `个人打分`,
        name: '个人打分',
        path: '/global/personage/dispose',
        component: '@/pages/global/grade/personage/dispose/index.tsx',
      },
      {
        title: `小组得分`,
        name: '小组得分',
        path: '/global/group/particulars',
        component: '@/pages/global/grade/group/particulars/index.tsx',
      },
      {
        title: `小组打分`,
        name: '小组打分',
        path: '/global/group/dispose',
        component: '@/pages/global/grade/group/dispose/index.tsx',
      },
      /**
       * 教师路由
       */
      {
        title: '项目课程表',
        path: '/teacher/course',
        component: '@/pages/teacher/course/index',
      },
      {
        title: '下发作业',
        path: '/teacher/work/arrangement',
        component: '@/pages/teacher/work/arrangement/index',
      },
      {
        title: '作业审批-未批复',
        path: '/teacher/work/correct/reply',
        component: '@/pages/teacher/work/correct/reply',
      },
      {
        title: '作业审批-已批复',
        path: '/teacher/work/correct/replied',
        component: '@/pages/teacher/work/correct/replied',
      },
      {
        title: '考勤管理-项目考勤',
        path: '/teacher/attendance/index',
        component: '@/pages/teacher/attendance/index',
      },
      {
        title: '考勤管理-门禁打卡',
        path: '/teacher/attendance/viewDetails',
        component: '@/pages/teacher/attendance/viewDetails',
      },
      {
        title: '综合打分-个人',
        path: '/teacher/score/personage',
        component: '@/pages/teacher/score/personage',
      },
      {
        title: '综合打分-小组',
        path: '/teacher/score/group',
        component: '@/pages/teacher/score/group',
      },
      {
        title: `请假管理`,
        name: '请假管理',
        path: '/teacher/askForLeave',
        component: '@/pages/teacher/askForLeave/index.tsx',
      },
      /**
       * 学生路由
       */
      {
        title: `个人信息`,
        path: '/student/info',
        component: '@/pages/student/info/index',
        routes: [
          {
            title: `个人信息`,
            path: '/student/info/team',
            component: '@/pages/student/info/table/team',
          },
          {
            title: `个人信息`,
            path: '/student/info/score',
            component: '@/pages/student/info/table/score',
          },
        ],
      },
      {
        title: `项目课程表`,
        path: '/course',
        component: '@/pages/student/course/index',
      },
      {
        title: `待提交`,
        path: '/student/work/submit',
        component: '@/pages/student/work/submit',
      },
      {
        title: `待批复`,
        path: '/student/work/approving',
        component: '@/pages/student/work/approving',
      },
      {
        title: `已批复`,
        path: '/student/work/approved',
        component: '@/pages/student/work/approved',
      },
      {
        title: `项目考勤记录`,
        path: '/student/attendance/project',
        component: '@/pages/student/attendance/project',
      },
      {
        title: `打卡记录`,
        path: '/student/attendance/clock',
        component: '@/pages/student/attendance/clock',
      },
      {
        title: `请假管理`,
        path: '/leave',
        component: '@/pages/student/leave/leave',
      },

      /**
       * 管理员路由
       */
      {
        title: `${WEB_NAME}-学生信息`,
        path: '/admin/studentInfo/index',
        component: '@/pages/admin/studentInfo/index',
        key: '1',
      },
      {
        title: `${WEB_NAME}-学生明细`,
        path: '/admin/studentInfo/studentDetail',
        component: '@/pages/admin/studentInfo/studentDetail',
        key: '2',
      },
      {
        title: `${WEB_NAME}-学生明细`,
        path: '/admin/studentInfo/sdEdit',
        component: '@/pages/admin/studentInfo/sdEdit',
        key: 'sdEdit',
      },
      {
        title: `${WEB_NAME}-教师信息`,
        path: '/admin/teacherInfo/index',
        component: '@/pages/admin/teacherInfo',
        key: 'teacherInfo',
      },
      {
        title: `${WEB_NAME}-项目组管理`,
        path: '/admin/projectTeam/index',
        component: '@/pages/admin/projectTeam',
        key: 'projectTeam',
      },
      {
        title: `${WEB_NAME}-已结业分组`,
        path: '/admin/projectTeam/hasCompleteTeam',
        component: '@/pages/admin/projectTeam/hasCompleteTeam',
        key: 'hasCompleteTeam',
      },
      {
        title: `${WEB_NAME}-课程管理`,
        path: '/admin/course/index',
        component: '@/pages/admin/course',
      },
      {
        title: `${WEB_NAME}-门禁打卡管理`,
        path: '/admin/attendance/entranceGuard',
        component: '@/pages/admin/attendance/entranceGuard',
      },
      {
        title: `${WEB_NAME}-项目考勤管理`,
        path: '/admin/attendance/itemAttendance',
        component: '@/pages/admin/attendance/itemAttendance',
      },
      {
        title: `${WEB_NAME}-项目考勤-请假原因`,
        path: '/admin/attendance/absenceReason',
        component: '@/pages/admin/attendance/absenceReason',
      },
      {
        title: `${WEB_NAME}-请假记录`,
        path: '/admin/absence/index',
        component: '@/pages/admin/absence',
      },
      {
        title: `${WEB_NAME}-个人评分`,
        path: '/admin/mark/personScore',
        component: '@/pages/admin/mark/personScore',
      },
      {
        title: `${WEB_NAME}-个人评分详情`,
        path: '/admin/mark/psDetail',
        component: '@/pages/admin/mark/psDetail',
      },
      {
        title: `${WEB_NAME}-个人综合评分`,
        path: '/admin/mark/psMark',
        component: '@/pages/admin/mark/psMark',
      },
      {
        title: `${WEB_NAME}-小组评分`,
        path: '/admin/mark/teamScore',
        component: '@/pages/admin/mark/teamScore',
      },
      {
        title: `${WEB_NAME}-小组评分详情`,
        path: '/admin/mark/tsDetail',
        component: '@/pages/admin/mark/tsDetail',
      },
      {
        title: `${WEB_NAME}-学生信息`,
        path: '/global/changePassword/index',
        component: '@/pages/global/changePassword/index',
      },
    ],
  },
];
export default routes;
